[Top] [Prev] [Next] [Bottom] [Contents]

SaExecSQL

Executes an SQL string, then returns a Callback Structure.

Synopsis

#include "WorkingDialog.h"
SaCallbackStruct *SaExecSQL(char *serv, 
										char *db, 
										int vendor, 
										char *statement);

Arguments

serv
pointer to server name to execute statement on. Oracle must use "ORACLE"
db
pointer to database name to execute statement on.
vendor
vendor id. (SGESYBASE, SGEORACLE, or SGEINFORMIX)
statement
pointer to a string containing an SQL statement to be processed.

Return Values

Returns a pointer to an SaCallbackStruct. This must be free'd by calling SaFreeCbs, once you are finished with it. NULL is returned if an error occurs.

Description

SaExecSQL allows ad hoc queries and SQL to be performed. By supplying the vendor, server, database and SQL string, you can execute any SQL statement in any vendor's environment.

All of the results of the SQL statement are returned in the SaCallbackStruct. Data can be accessed in the same manner any Population Callback would access the callback structure.

Stored Procedures can be executed as well. Simply create the execute statement, with all of the arguments for the procedure, and use it as the statement argument to SaExecSQL().

The types of SQL which can be used are:

Sybase: Transact SQL
Oracle: SQL and PL/SQL
Informix: SQL and SPL (SPL only to execute or Create procedures)

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.